const http = require('http')
const server = http.createServer()
server.on('request',(req)=>{
    // req.url是客户端的请求url地址
    const url = req.url
    // req.method是客户端的method类型
    const method=req.method
    const str = `你的请求地址是${url},请求方是${method}`
    console.log(str);
})
server.listen(8080,()=>{
    console.log('server runing at http://127.0.0.1');
})